﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IceDog.DNF.Program.BookAPI.Models
{
    /// <summary>
    /// 书模型
    /// </summary>
    public class Book
    {
        /// <summary>
        /// 书编号
        /// </summary>
        public int BookId { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        [Required]
        public string Title { get; set; }
        /// <summary>
        /// 价格
        /// </summary>
        public decimal Price { get; set; }
        /// <summary>
        /// 类别
        /// </summary>
        public string Genre { get; set; }
        /// <summary>
        /// 出版时间
        /// </summary>
        public DateTime PublishDate { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 作者id
        /// </summary>
        public int AuthorId { get; set; }
        /// <summary>
        /// 作者模型
        /// </summary>
        [ForeignKey("AuthorId")]
        public Author Author { get; set; }
    }
}